<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <link rel="stylesheet" type="text/css" href="../../css/aui.css">
    <link rel="stylesheet" type="text/css" href="../../css/aui-slide.css">
    <link rel="stylesheet" type="text/css" href="../../css/api.css">
    <script type="text/javascript" src="../../script/api.js"></script>
</head>

<body>
    <header class="aui-bar aui-bar-nav aui-bar-pink" style="background-color: #f7911b;height: 3rem;">
        <div class="aui-pull-left aui-btn" style="margin-top: 0.4rem;" onclick="api.closeWin()">
            <span class="aui-iconfont aui-icon-left"></span>
        </div>
        <div class="aui-title" >返利提醒</div>
    </header>
    <section class="aui-content-padded" id="content" style="display: flex;flex-direction: column-reverse;">

    </section>
</body>
<script type="text/javascript">
    apiready = function() {
        var body={
          token:$api.getStorage('token')
        };
        api.ajax({
            url: 'http://www.mk517.com/webApi/fanli.php',
            method: 'post',
            "headers": {
                "Content-Type": "application/json"
            },
            dataType: "json",
            data: {
                body: body,
                id:0

            }
        }, function(ret, err) {
            // alert(JSON.stringify(ret));
            if (ret) {
                
                for (var i = 0; i < ret.length; i++) {
                    data = ret[i];
                
                    var s=0;
                    if(data.status == 0){
                          $api.byId('content').innerHTML += '<div><p style="margin-top: 0.8rem;margin-left: 1rem;">'+data.time+'</p>'+
                    '<div class="rebate_div"   style=" margin-left:0.8rem;margin-top:0.5rem;"><span class="rebate_one " >&nbsp;&nbsp;&nbsp;审核中</span><span class="rebate_two" onclick="adelete()">删除</span></div>'+
                    '<div class="to_account" style="margin-left:0.8rem;margin-top:0.1rem; ">'+
                       '<table style="margin-left:0.5rem;margin-top:0.5rem;float:left"><tr>'+
                        '<td style="width:5rem;">到账金额:</td><td>'+data.money+'元</td></tr>'+
                       '<tr><td>提现方式:</td><td><p id="fangli_address" >+ 支付宝 </p></td></tr>'+
                    //    '<tr><td>到账时间:</td><td>' + s + '</td></tr>' +
                       '</table></div></div>'+
                       ' <input type="hidden" value="'+data.id+'" >'
                    }else if(data.status == 1){
                        $api.byId('content').innerHTML += '<div><p style="margin-top: 0.8rem;margin-left: 1rem;">'+data.time+'</p>'+
                    '<div class="rebate_div" style=" margin-left:0.8rem;margin-top:0.5rem;"><span class="rebate_one " >&nbsp;&nbsp;&nbsp;提现成功</span><span class="rebate_two"  onclick="adelete()">删除</span></div>'+
                    '<div class="to_account" style="margin-left:0.8rem;margin-top:0.1rem; ">'+
                       '<table style="margin-left:0.5rem;margin-top:0.5rem;float:left"><tr>'+
                        '<td style="width:5rem;">到账金额:</td><td>'+data.money/100+'元</td></tr>'+
                       '<tr><td>提现方式:</td><td><p id="fangli_address" >支付宝 </p></td></tr>'+
                    //    '<tr><td>到账时间:</td><td>' + s + '</td></tr>' +
                       '</table></div></div>'+
                      ' <input type="hidden" value="'+data.id+'" >'
                    }else if(data.status == 2){
                        $api.byId('content').innerHTML += '<div><p style="margin-top: 0.8rem;margin-left: 1rem;">'+data.time+'</p>'+
                    '<div class="rebate_div" style=" margin-left:0.8rem;margin-top:0.5rem;"><span class="rebate_one " >&nbsp;&nbsp;&nbsp;提现失败</span><span class="rebate_two"  onclick="adelete()">删除</span></div>'+
                    '<div class="to_account" style="margin-left:0.8rem;margin-top:0.1rem; ">'+
                       '<table style="margin-left:0.5rem;margin-top:0.5rem;float:left"><tr>'+
                        
                        // '<td style="width:5rem;">原因:</td><td></td></tr>'+
                       '<tr><td>'+data.why+'</td></tr>'+
                    //    '<tr><td>到账时间:</td><td>' + s + '</td></tr>' +
                       '</table></div></div>'+
                       ' <input type="hidden" value="'+data.id+'" >'
                    }
                    // var s=0;
                    // $api.byId('content').innerHTML += '<p style="margin-top: 0.8rem;margin-left: 1rem;">'+s+'</p>'+
                    // '<div class="rebate_div" style=" margin-left:0.8rem;margin-top:0.5rem;"><span class="rebate_one " >&nbsp;&nbsp;&nbsp;提现成功</span><span class="rebate_two">删除</span></div>'+
                    // '<div class="to_account" style="margin-left:0.8rem;margin-top:0.1rem; ">'+
                    //    '<table style="margin-left:0.5rem;margin-top:0.5rem;float:left"><tr>'+
                    //     '<td style="width:5rem;">到账金额:</td><td>'+s+'</td></tr>'+
                    //    '<tr><td>返账方:</td><td><p id="fangli_address" >' + s + '</p></td></tr>'+
                    //    '<tr><td>到账时间:</td><td>' + s + '</td></tr>' +
                    //    '</table></div>' +


                    //    '<p style="margin-top:1rem;margin-left: 1rem;">'+s+'</p>'+
                    //    '<div class="" style="background-color: #fff;margin-top:0.5rem;margin-left:0.8rem;width:16.3rem;height:2.5rem;line-height:2.5rem;"><span class=" " style="margin-left:0.5rem;">审核中......</span><span class="rebate_two">删除</span></div>'+
                    //     '<div style="width:16.3rem;;height:6rem;background-color:#fff;margin-left:0.8rem;margin-top:0.1rem;"><table style="margin-top:0.5rem;margin-left:0.5rem;"><tr>'+
                    //     '<td style="width:5rem;">提现金额:</td><td>'+s+'</td></tr>'+
                    //    '<tr><td>提现到:</td><td><p id="fangli_address" >' + s + '</p></td></tr>'+
                    //    '<tr><td>提现时间:</td><td>' + s + '</td></tr>' +
                    //    '</table> </div>'
                       
                       
                       
                       
                       
                        // +'<div class="aui-card-list">' +
                        // '<div class="aui-card-list-header aui-card-list-user aui-border-b">' +
                        
                        // '<span class="aui-card-list-user-info" id="fanli_rq">' + data.fanli_rq + '</span></div>' +
                        // '<div class="aui-card-list-content-padded">' +
                        // '<h1 id="fanli_money">' + data.fanli_money + '</h1></div>' +
                        // '<div class="aui-card-list-footer">' +
                        // '<span class="aui-font-size-15">返账方：<p id="fangli_address">' + data.fangli_address + '</p></span></div>' +
                        // '<div class="aui-card-list-footer">到账时间：<p id="fanli_time">' + data.fanli_time + '</p></div></div>' +
                        // '<div class="aui-card-list-footer" id="time_2">' + data.time_2 + '</div>' +
                //         '<div class="aui-card-list">' +
                //         '<div class="aui-card-list-header aui-card-list-user aui-border-b">' +
                //         '<div class="aui-card-list-user-name">提现到账成功</div>' +
                //         '<span class="aui-card-list-user-info" id="TX_time1">' + data.TX_time1 + '</span></div>' +
                //         '<div class="aui-card-list-content-padded">' +
                //         '<h1 id="TX_money">' + data.TX_money + '</h1></div>' +
                //         '<div class="aui-card-list-footer">' +
                //         '<span class="aui-font-size-15">提现到：<p id="TX_address">' + data.TX_address + '</p></span></div>' +
                //         '<div class="aui-card-list-footer">到账时间：<p id="TX_Time">' + data.TX_Time + '</p></div></div>'
                }

            } else {
                //  alert(JSON.stringify(err));
                alert("暂无数据")
            }
        });


        window.adelete= function(){
    
    var token = $api.getStorage('token');
 	var token = {
                token: token,
                id:data.id
            };
        api.ajax({
            url: 'http://www.mk517.com/webApi/fanli.php',
            method: 'post',
            "headers": {
                "Content-Type": "application/json"
            },
            dataType: "json",
            data: {
                body: token
                
            }
        }, function(ret, err) {
            alert('删除成功!');
            window.location.reload();

            // alert(JSON.stringify(ret));
            // if (ret) {
            //   console.log(ret);
                
            //  }else {
            //     alert(JSON.stringify(err));
            // }
        });


    
};

        
    }

</script>

</html>
